package org.huangxq.bigscreen.data

import jakarta.persistence.Column
import jakarta.persistence.EmbeddedId
import jakarta.persistence.Entity
import jakarta.persistence.Lob
import java.io.Serializable

@Entity(name = "ind_complex")
data class ComplexIndConfigData(
    @EmbeddedId
    var key: ComplexIndConfigId = ComplexIndConfigId(), //主题代码
    var title: String = "",    //标题名称
    var dbID:  String = "", //数据库代码
    @Lob
    @Column(columnDefinition = "CLOB")
    var sqlConfig:  String  = "", //sql语句
    @Column(name = "\"real\"")
    var real: Boolean = false, //是否为实时指标
)

data class ComplexIndConfigId(
    var id: String = "", //主题代码
    var indId: String = "", //指标代码
): Serializable{
    constructor(): this("", "")
}

data class SqlConfig(
    var name: String = "",
    var sql: String = ""
)

data class ComplexIndConfigBO(
    var key: ComplexIndConfigId = ComplexIndConfigId(), //主题代码
    var title: String = "",    //标题名称
    var dbID: String = "", //数据库代码
    var sqlConfig: List<SqlConfig> = mutableListOf(), //sql语句
    var real: Boolean = false, //是否为实时指标
)